package com.zhima.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhima.dto.BatchImportQuestionInfo;
import com.zhima.dto.CreateQuestionDTO;
import com.zhima.dto.UpdateTestCaseTemplateDTO;
import com.zhima.dto.UserDTO;
import com.zhima.entity.OjQuestion;
import com.zhima.enums.QuestionScope;
import com.zhima.vo.*;

import java.io.InputStream;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zhima
 * @since 2023-08-25
 */
public interface OjQuestionService extends IService<OjQuestion> {

    Page<QuestionVO> pageQueryQuestionBasicInfo(Long userId, Long pageNum, Long pageSize);

    boolean deleteQuestionById(Long userId, Long questionId);

    OjQuestion createNewQuestion(UserDTO userDTO, CreateQuestionDTO createQuestionDTO, String prefix);

    boolean supplyDetail(Long userId, CreateQuestionDTO createQuestionDTO);

    QuestionPublishDetailVO queryQuestionDetailById(Long userId, Long questionId);

    List<SimpleQuestionVO> batchQuerySimpleQuestionByIds(List<Long> questionIds);

    boolean updateQuestionScope(Long userId, Long questionId, QuestionScope questionScope);

    boolean updateTestCases(Long userId, InputStream inputStream, Long questionId);

    BatchImportQuestionInfo[] batchImportQuestions(InputStream inputStream);

    QuestionEditVO queryQuestionEditById(Long userId, Long questionId);

    TestCaseTemplateVO getTestCasesTemplate(Long questionId);

    boolean updateTestCasesTemplate(Long questionId, UpdateTestCaseTemplateDTO updateTestCaseTemplateDTO);

    byte[] downloadTestCase(Long questionId);

    BatchImportQuestionInfo[] batchImportQuestionInfos(Long userId);

    boolean deleteBatchQuestionInfo(Long userId, String questionName);
}
